package com.example.glgk.controller.analysis;

import com.example.glgk.dto.indicator.*;
import com.example.glgk.service.DepartmentIndicatorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author liuxingkun
 *
 */
@Api(tags = "科室/部门 计算接口")
@Slf4j
@RestController
@RequestMapping("/DepartmentIndicatorController")
@CrossOrigin(origins = "*")
public class DepartmentIndicatorController {

    @Autowired
    DepartmentIndicatorService departmentIndicatorService;


    @ApiOperation(value ="查询部门/科室 负责的相关指标信息")
    @PostMapping("/getResponsibleIndicators")
    public List<ResponsibleIndicator> getResponsibleIndicators(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getResponsibleIndicators(indicatorCalculateDto);
    }

    @ApiOperation(value ="查询科室 循环数据")
    @PostMapping("/getDataList")
    public List<DataListDto> getDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getDataList(indicatorCalculateDto);
    }

    @ApiOperation(value ="科室报告-监测指标-具体分析")
    @PostMapping("/getMonitorIndicatorDataList")
    public List<DataListDto> getMonitorIndicatorDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getMonitorIndicatorDataList(indicatorCalculateDto);
    }

    @ApiOperation(value ="科室报告-非监测指标-具体分析")
    @PostMapping("/getCommonIndicatorDataList")
    public List<DataListDto> getCommonIndicatorDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getCommonIndicatorDataList(indicatorCalculateDto);
    }

    @ApiOperation(value ="科室报告-DRG病组信息")
    @PostMapping("/getDrgGroupDataList")
    public List<DrgGroupDataDto> getDrgGroupDataList(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getDrgGroupDataList(indicatorCalculateDto);
    }

    @ApiOperation(value ="科室报告-24h出入院病人情况")
    @PostMapping("/getPatientsInOutHospitalList")
    public List<PatientsInOutDto> getPatientsInOutHospitalList(@RequestBody IndicatorCalculateDto indicatorCalculateDto){
        return departmentIndicatorService.getPatientsInOutHospitalList(indicatorCalculateDto);
    }




}
